import { TARGET_TYPE } from '../constants/common';

// 订单支持配送方式
export const DELIVERY_TYPE_ENUM = {
    self: 'self_pickup',
    express: 'express',
    none: 'no',
    city: 'in_city',
};

export const DELIVERY_TYPE_TEXT = {
    [DELIVERY_TYPE_ENUM.self]: '顾客自提',
    [DELIVERY_TYPE_ENUM.express]: '商家配送',
    [DELIVERY_TYPE_ENUM.none]: '无需配送',
    [DELIVERY_TYPE_ENUM.city]: '同城配送',
};

export const ORDER_TYPE_ENUM = {
    all: 'all',
    pay: 'pay',
    wait: 'send',
    complate: 'complate',
    afterSale: 'service',
};

// 订单列表分组
export const ORDERLIST_TABS = [{
    value: 'all',
    name: ORDER_TYPE_ENUM.all,
    title: '全部',
}, {
    value: 'created,pending',
    name: ORDER_TYPE_ENUM.pay,
    title: '待付款',
}, {
    value: 'payed',
    name: ORDER_TYPE_ENUM.wait,
    title: '待发货',
}, {
    value: 'delivered,prepared',
    name: ORDER_TYPE_ENUM.complate,
    title: '待收货',
}, {
    name: ORDER_TYPE_ENUM.afterSale,
    title: '售后',
}];

// 订单归属枚举
export const ORDER_OWNER_TYPE = {
    brand: TARGET_TYPE.brand, // 商家
    store: TARGET_TYPE.store, // 店铺
    spokesman: TARGET_TYPE.spokesman, // 代言人
};

// 订单过滤条件
export const ORDER_FILTER_TYPE = {
    activity: 'activity', // 活动
    distributor: TARGET_TYPE.distributor, // 分销员
    spokesman: TARGET_TYPE.spokesman, // 代言人
    brand: TARGET_TYPE.brand, // 品牌
    store: TARGET_TYPE.store, // 店铺
};

// 订单类型
export const ORDER_TYPE = {
    SALE: 'sale', // 售卖单
    REDEEM_AWARD: 'redeem_award', // 兑换奖励单
};

// 订单状态
export const ORDER_STATUS = {
    ORDER_CREATED: 'created', // 已创建
    ORDER_TO_PAY: 'to_pay', // 货到付款
    ORDER_NEED_PAY: 'pending', // 待付款
    ORDER_PAYED: 'payed', // 已支付
    ORDER_DELIVERED: 'delivered', // 已发货(快递模式)
    ORDER_PREPARED: 'prepared', // 已备货(自提模式)
    ORDER_CANCELLING: 'cancelling', // 取消申请中(瞬态可以忽略)
    ORDER_COMPLETE: 'finished', // 已完成
    ORDER_CLOSE_BEFORE: 'before_pay_closed', // 付款前关闭
    ORDER_CLOSE_AFTER: 'after_pay_closed', // 付款后关闭
};

// 售后订单状态
export const AFTER_ORDER_STATUS = {
    APPLYING: 'created', // 申请中
    WAITE_SEND_BACK: 'wait_send', // 等待用户寄出
    USER_SENDED: 'sended', //用户确认寄出
    BRAND_RECEIVED: 'received', //商家确认收货
    WAITE_PAY_BACK: 'refunding', //退款中
    COMPLATE: 'finished', // 已完成
    CLOSE: 'closed', // 已关闭
};

// 订单售后类型
export const ORDER_AFTER_SALE_TYPE = {
    all: 'refund', // 整单取消
    onlyRefund: 'refund', // 仅退款
    refundAndSale: 'refund_and_return_goods', // 退货退款
};

export const AGREE_BTN_TEXT = {
    [ORDER_AFTER_SALE_TYPE.all]: '同意退款',
    [ORDER_AFTER_SALE_TYPE.onlyRefund]: '同意退款',
    [ORDER_AFTER_SALE_TYPE.refundAndSale]: '同意退货',
};

export const REFUSE_BTN_TEXT = {
    [ORDER_AFTER_SALE_TYPE.all]: '拒绝退款',
    [ORDER_AFTER_SALE_TYPE.onlyRefund]: '拒绝退款',
    [ORDER_AFTER_SALE_TYPE.refundAndSale]: '拒绝退货',
};

export const AFTER_SALE_TYPE_LIST = [{
    name: '仅退款（无需退货）',
    value: ORDER_AFTER_SALE_TYPE.onlyRefund,
}, {
    name: '退货退款',
    value: ORDER_AFTER_SALE_TYPE.refundAndSale,
}];

// 商品收货状态
export const PRODUCT_RECEIVING_STATUS = {
    no: 'not_received',
    yes: 'received',
};

// 订单商品状态
export const GOODS_STATUS_TYPE = [{
    value: PRODUCT_RECEIVING_STATUS.no,
    text: '未收到货',
}, {
    value: PRODUCT_RECEIVING_STATUS.yes,
    text: '已收到货',
}];

// 退款原因-退款
export const ORDER_REFUND_REASON = [
    '多拍/错拍/不想要',
    '快递一直未送到',
    '未按约定时间发货',
    '快递无跟踪记录',
    '少货/空包裹',
];

// 退款原因-退款退货
export const ORDER_SALES_RETURN_REASON = [
    '不喜欢',
    '质量问题',
    '实物与描述不符',
    '卖家发错货',
    '假冒品牌',
];

// 快递列表
export const EXPRESS_LIST = [
    'EMS',
    '中通快递',
    '顺丰快递',
    '邮政快递',
    '圆通快递',
    '申通快递',
    '韵达快递',
    '天天快递',
    '全峰快递',
    '百世快递',
    '其他快递',
];